package com.landinfo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * app地图服务管理
 * Create by wj
 * 2018-10-23
 */
@ApiModel(description = "app地图服务管理 Create by wj 2018-10-23")
@Entity
@Table(name = "app_map_service_manage")
// @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class AppMapServiceManage implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 服务名称
     */
    @ApiModelProperty(value = "服务名称")
    @Column(name = "name")
    private String name;

    /**
     * 服务类型
     */
    @ApiModelProperty(value = "服务类型")
    @Column(name = "jhi_type")
    private String type;

    /**
     * 服务地址
     */
    @ApiModelProperty(value = "服务地址")
    @Column(name = "map_service_url")
    private String mapServiceUrl;

    /**
     * 是否需要判断用户来显示与否
     */
    @ApiModelProperty(value = "是否需要判断用户来显示与否")
    @Column(name = "is_show_by_user")
    private Boolean isShowByUser;

    /**
     * 需要显示的用户
     */
    @ApiModelProperty(value = "需要显示的用户")
    @Column(name = "users")
    private String users;

    /**
     * 是否启用
     */
    @ApiModelProperty(value = "是否启用")
    @Column(name = "jhi_enable")
    private Boolean enable;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @Column(name = "sort")
    private Integer sort;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public AppMapServiceManage name(String name) {
        this.name = name;
        return this;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public AppMapServiceManage type(String type) {
        this.type = type;
        return this;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMapServiceUrl() {
        return mapServiceUrl;
    }

    public AppMapServiceManage mapServiceUrl(String mapServiceUrl) {
        this.mapServiceUrl = mapServiceUrl;
        return this;
    }

    public void setMapServiceUrl(String mapServiceUrl) {
        this.mapServiceUrl = mapServiceUrl;
    }

    public Boolean isIsShowByUser() {
        return isShowByUser;
    }

    public AppMapServiceManage isShowByUser(Boolean isShowByUser) {
        this.isShowByUser = isShowByUser;
        return this;
    }

    public void setIsShowByUser(Boolean isShowByUser) {
        this.isShowByUser = isShowByUser;
    }

    public String getUsers() {
        return users;
    }

    public AppMapServiceManage users(String users) {
        this.users = users;
        return this;
    }

    public void setUsers(String users) {
        this.users = users;
    }

    public Boolean isEnable() {
        return enable;
    }

    public AppMapServiceManage enable(Boolean enable) {
        this.enable = enable;
        return this;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AppMapServiceManage appMapServiceManage = (AppMapServiceManage) o;
        if (appMapServiceManage.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), appMapServiceManage.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "AppMapServiceManage{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", type='" + getType() + "'" +
            ", mapServiceUrl='" + getMapServiceUrl() + "'" +
            ", isShowByUser='" + isIsShowByUser() + "'" +
            ", users='" + getUsers() + "'" +
            ", enable='" + isEnable() + "'" +
            "}";
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
}
